let htmlWidth = document.documentElement.clientWidth
document.documentElement.style.fontSize = htmlWidth / 16 + 'px'
console.log(document.documentElement.style.fontSize)
function changeRem () {
  let timer = null
  return function () {
    if (!timer) {
      timer = setTimeout(() => {
        htmlWidth = document.documentElement.clientWidth
        document.documentElement.style.fontSize = htmlWidth / 16 + 'px'
        timer = null
      }, 100)
    }
  }
}

window.addEventListener('resize', changeRem())
